The WORKITEM Sample

The WORKITEM Sample accompanies Chapter 9 and illustrates how to use ExQueueWorkItem to queue a work item. (Refer to the PNPMON sample in Chapter 6 for an illustration of how to use the newer function IoQueueWorkItem instead of ExQueueWorkItem.)

The sample includes two components:

Building WORKITEM

To build WORKITEM.SYS, follow the general instructions for building a WDM sample. The Microsoft Visual C++ project file is named WORKITEM.DSP.

To build TEST.EXE, follow the general instructions for building user-mode programs. The Microsoft Visual C++ project file is named TEST.DSP in the TEST subdirectory.

Testing WORKITEM

First install the WORKITEM.SYS driver. Follow the general instructions for using FastInst in Windows 2000 or the Add New Hardware wizard in Windows 98. The INF file is named SYS\DEVICE.INF.

Open a command prompt and execute TEST.EXE from the TEST\DEBUG subdirectory. TEST will call WORKITEM to queue a work item that should complete almost immediately and report back to TEST. TEST prints a message to indicate the results.